#include "UdpServer.hpp"
#include <iostream>
#include <unistd.h>
#include <memory>
#include <string>
#include <unistd.h>
#include "Route.cc"

int main(int argc, char *args[])
{
    if (argc != 2)
    {
        std::cout << "./UdpServer Serverport" << std::endl;
    }
    uint16_t port = std::stoi(args[1]);

    Route route;
    server_t task = std::bind(&Route::Forward, &route, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3);
    std::unique_ptr<UdpServer> usvr = std::make_unique<UdpServer>(task, port);
    usvr->InitServer();
    usvr->Start();
    return 0;
}